package com.demo.enums;

/**
 * 病人状态枚举：状态，诊断时间 1 新入 2 术后 3 分娩 4 出院
 */
public enum PatientStatusEnum {
    XIN_RU(1, "新入"),
    SHU_HOU(2, "术后"),
    FEN_MIAN(3, "分娩"),
    CHU_YUAN(4, "出院");

    private int value;
    private String desc;

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    PatientStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static PatientStatusEnum getByValue(Integer value) {
        for (PatientStatusEnum item : values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        return null;
    }
}
